var path = require('path');
// const ExtractTextPlugin  = require("extract-text-webpack-plugin");
// html处理
// const HtmlWebpackPlugin  = require('html-webpack-plugin');

// 获取html-webpack-plugin的option

module.exports = {
    entry: "./src/js/root.js",
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['es2015', 'react'],
                    }
                },
                exclude: /node_modules/
            },
            { test: /\.css$/, use: ["style-loader", "css-loader"] }
        ]
        /*loaders: [
            {
                test: /\.js?$/,
                exclude: /(node_modules)/,
                loader: 'babel-loader',
                query: {
                    presets: ['react', 'es2015']
                }
            }
        ]*/
    },
    output: {
        path: __dirname,
        filename: "./src/bundle.js"
    },
    /*devServer: {
        // 本地服务器所加载页面所在目录
        contentBase: 'src',
        // historyApiFallback: true,

    }*/
};
